package justdoit.spring.service;

import justdoit.spring.dao.PaymentDAO;
import justdoit.spring.domain.Payment;
import java.util.Set;
import javax.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * 
 * @author
 */
@Service(value = "paymentService")
public class PaymentServiceImpl implements PaymentService {

	@Resource(name = "paymentDAO")
	private PaymentDAO dao;

	public void addPayment(Payment payment) {
		// debit money logic
		dao.savePayment(payment);
	}

	public Set<Payment> getPayments() {
		return dao.getPayments();
	}

	public Payment get(long id) {
		return dao.get(id);
	}
}